package com.qdlc.p2p.manage.action.additional;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.service.ActivityAwardLogService;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.common.util.BeanUtil;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.model.ActivityAwardLogModel;

public class ManageActivityAwardLogAction extends BaseAction<ActivityAwardLogModel> implements ModelDriven<ActivityAwardLogModel>{
	
	@Resource
	private ActivityAwardLogService activityAwardLogService;
	
	private Map<String, Object> data;
	
	public Map<String, Object> getData() {
		return data;
	}
	public void setData(Map<String, Object> data) {
		this.data = data;
	}
	
	
	@Action("/modules/additional/activityPlan/activityAwardLogManager")
	public String activityPlanManager(){
		return "activityAwardLogManager";
	}
	
	/**
	 * 活动奖励列表查询
	 * @throws IOException
	 */
	@Action(value = "/modules/additional/activityPlan/activityAwardLogList")
	public void activityAwardLogList() throws IOException{
		data = new HashMap<String, Object>();
		activityAwardLogService = (ActivityAwardLogService) BeanUtil.getBean("activityAwardLogService");
		PageDataList<ActivityAwardLogModel> plist = activityAwardLogService.manageList(model);
		data.put("total", plist.getPage().getTotal());
		data.put("rows", plist.getList());
		printJson(getStringOfJpaObj(data));
	}
		
}
